package com.dmap.knowledge.vo;

import com.dmap.knowledge.controller.api.param.ArticleAppParam;
import com.dmap.knowledge.controller.api.param.ArticleTagParam;
import com.dmap.knowledge.po.Article;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class ArticleVo implements Serializable {

    private String articleId;                                //文章ID
    private String lang;                                    //语言
    private List<ArticleAppParam> app = new ArrayList<>();  //app详情
    private String coverUrl;                                //封面url
    private String articleUrl;                              //articleUrl
    private String summary;                                 //详情
    private String title;                                   //标题
    private long publishTime;                               //出版时间
    private int browseNumber;                               //浏览数量
    private int publish;                                    //出版
    private long endTime;                                   //结束时间
    private long startTime;                                 //开始时间
    private long updateTime;                                //更新时间
    private List<ArticleTagParam> tags = new ArrayList<>(); //article标签

    public ArticleVo() {
    }

    public ArticleVo(Article article) {
        this.articleId = article.getId().toString();
        this.lang = article.getLang();
        this.coverUrl = article.getCoverUrl();
        this.articleUrl = article.getArticleUrl();
        this.summary = article.getSummary();
        this.title = article.getTitle();
        this.publishTime = article.getPublishTime();
        this.browseNumber = article.getBrowseNumber();
        this.publish = article.getPublish();
        this.endTime = article.getUsefulTime();
        this.startTime = article.getPublishTime();
        this.updateTime = article.getUpdateTime();
    }

    public String getArticleId() {
        return articleId;
    }

    public void setArticleId(String articleId) {
        this.articleId = articleId;
    }

    public String getLang() {
        return lang;
    }

    public void setLang(String lang) {
        this.lang = lang;
    }

    public List<ArticleAppParam> getApp() {
        return app;
    }

    public void setApp(List<ArticleAppParam> app) {
        this.app = app;
    }

    public String getCoverUrl() {
        return coverUrl;
    }

    public void setCoverUrl(String coverUrl) {
        this.coverUrl = coverUrl;
    }

    public String getArticleUrl() {
        return articleUrl;
    }

    public void setArticleUrl(String articleUrl) {
        this.articleUrl = articleUrl;
    }

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public long getPublishTime() {
        return publishTime;
    }

    public void setPublishTime(long publishTime) {
        this.publishTime = publishTime;
    }

    public int getBrowseNumber() {
        return browseNumber;
    }

    public void setBrowseNumber(int browseNumber) {
        this.browseNumber = browseNumber;
    }

    public int getPublish() {
        return publish;
    }

    public void setPublish(int publish) {
        this.publish = publish;
    }

    public long getEndTime() {
        return endTime;
    }

    public void setEndTime(long endTime) {
        this.endTime = endTime;
    }

    public long getStartTime() {
        return startTime;
    }

    public void setStartTime(long startTime) {
        this.startTime = startTime;
    }

    public long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(long updateTime) {
        this.updateTime = updateTime;
    }

    public List<ArticleTagParam> getTags() {
        return tags;
    }

    public void setTags(List<ArticleTagParam> tags) {
        this.tags = tags;
    }
}
